<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1, user-scalable=no, minimal-ui">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <title>意见反馈</title>
    <!-- Path to Framework7 Library CSS-->
    <link rel="stylesheet" href="../css/framework7.ios.min.css">
    <link rel="stylesheet" href="../css/framework7.ios.colors.min.css">
    <!-- Path to your custom app styles-->
    <link rel="stylesheet" href="../css/my-app.css">
    <link rel="stylesheet" href="../css/ekang.css"/>
    <style type="text/css">
        .backview {
            position: relative;
            width: 95.5%;
            height: 160px;
            margin-left: 2%;
            margin-top: 10px;
            border-radius: 8px;
            background-color: #fff;
            border: 1px solid #d9d9d9;
        }
        
        .backview textarea {
            position: absolute;
            height: 120px;
            width: 94%;
            left: 10px;
            top: 10px;
            border: none;
            font-size: 13px;
            color: #999999;
        }

        .submit {
            position: relative;
            width: 95.5%;
            height: 44px;
            margin-top: 30px;
            margin-left: 2%;
            border: none;
            border-radius: 22px;
            color: white;
            font-size: 16px;
            background-color: #43af80;
        }
    </style>
</head>
<body>

<div class="views tabs toolbar-through">
    <!--导航条-->
    <!-- Second view (for second wrap)-->
    <div id="view" class="view view-main tab active">
        <!-- We can make with view with navigation, let's add Top Navbar-->
        <div class="navbar">
            <div class="navbar-inner" style="background-color: #38a16d">
                <div class="left" id="back">
                    <a href="#" class="back link">
                        <i class="icon icon-back color-white" style="color: white"></i>
                        <span style="color: white">返回</span>
                    </a>
                </div>
                <div class="center sliding" style="color: white">意见反馈</div>
            </div>
        </div>

        <div class="pages navbar-through">
            <div data-page="index-2" class="page page-on-center">
                <div class="page-content">
                    <div class="backview">
                        <textarea placeholder="请描述你遇到的问题或对易康的建议..." id="content"></textarea>
                        <div style="position: absolute;bottom: 5px;right: 10px;color: #999999">
                            <span id="content_num">0</span><span>/500</span>
                        </div>
                    </div>
                    <button class="submit" id="submit">提交</button>
                </div>
            </div>
        </div>
    </div>

</div>
<script type="text/javascript" src="../js/framework7.min.js"></script>
<script type="text/javascript" src="../js/my-app.js"></script>
<script src="../js/jquery-1.10.2.js"></script>
<script src="../js/ekang.js"></script>
<script src="../js/jquery.cookie.js"></script>
<script>
    $(function () {
        var content = $('#content');
        content.keyup(function () {
            var num = content.val().length;
            if(num >= 500){
                alert("最多输入500字");
                return;
            }
            $('#content_num').html(num);
        });

        $('#submit').on('click', function () {
            app.submitfeedBack();
        });

        $('#back').click(function () {
            history.back();
        });

        var app = {
            submitfeedBack: function () {
                $.ajax({
                    type: 'POST',
                    url: textUrl + '/user/feedBack',
                    data: {         // 需要于客户端同步
                        uid : $.cookie("local_userId"),
                        mobile : getQueryString("phone"),
                        content : content.val(),
                        type : '2'
                    },
                    dataType: 'jsonp',
                    jsonp: 'callback',
                    success: function (result) {
                        if (result.ret == 0) {
                            content.val("");
                            $('#content_num').html("0");
                            $.jTip("提交成功",2000);
                        } else {
                            alert(result.msg);
                        }
                    }
                });
            },
        };

    });
</script>
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js" type="text/javascript"></script>
<script src="../js/weixin2.js"></script>
</body>
</html>